<template>
	<view class="content">
		<!--list列表-->
		<view class="content-top">
			<uni-list>
				<uni-list-item style="padding-top: 40rpx;" title="测试服务设置" thumb="../../static/img/setting/p0.png" thumbSize="sm" link @click="test_serve()"></uni-list-item>
				<uni-list-item title="会员中心" thumb="../../static/img/setting/p1.png" thumbSize="sm" link @click="member()"></uni-list-item>
				<uni-list-item title="版本更新" thumb="../../static/img/setting/p2.png" thumbSize="sm" link @click="update()"></uni-list-item>
				<uni-list-item title="使用帮助" thumb="../../static/img/setting/p3.png" thumbSize="sm" link @click="assist()"></uni-list-item>
				<uni-list-item title="意见反馈" thumb="../../static/img/setting/p4.png" thumbSize="sm" link @click="feedback()"></uni-list-item>
				<uni-list-item style="height: 110rpx;" title="清除缓存" :showArrow="showInfo" thumb="../../static/img/setting/p5.svg" thumbSize="sm" @click="clearData()">
					<template v-slot:right="">
						<cmd-progress type="dashboard" :percent="percent" status="normal" width="50" v-if="isShow"></cmd-progress>
						<text style="font-family: '微软雅黑';font-weight: 400;font-style: normal;color: rgb(187, 187, 187)" v-if="istrue" >{{number}}MB</text>
					</template>
				</uni-list-item>
			</uni-list>
		</view>
		<!--底部内容-->
		<view class="content-footer">
			<text @click="switchAccounts()">切换账号</text>
			<text @click="loginOut()">退出登陆</text>
		</view>
	</view>	
</template>

<script>
	import uniList from '../../components/uni-list/uni-list.vue'
	import uniListItem from '../../components/uni-list-item/uni-list-item.vue'
	import cmdProgress  from '../../components/cmd-progress/cmd-progress.vue'
	export default {
		components: {		
			uniList,
			uniListItem,
			cmdProgress
		},
		data() {
			return {
			percent:0,
			isShow:false,
			number:33.2	,
			istrue:true,
			showInfo:false
			}
		},
		methods: {
			// 测试服务设置
			test_serve() {
				uni.navigateTo({
					url:'../testSetting/testSetting'
				})
			},
			// 清除缓存
			clearData(){
				this.isShow=true
				this.istrue=false
				setInterval(_=>{
					this.percent+=20
					if(this.percent==120){
						this.isShow=false
						this.number=0
						this.percent=0
						this.istrue=true
					}
				},500)			
			},
			// 切换账号
			switchAccounts(){
				
			},
			// 退出登录
			loginOut(){
				uni.redirectTo({
				   url:"../login/login"
				});	
			}	
	 }
	}
</script>

<style lang="scss">
.content{
   height: calc(100% - 44px);
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
   background-color: rgba(246, 246, 246, 1);
   .content-top{
	width: 100%;
	height: 56%;
	background: #FFFFFF;
	display: flex;
	justify-content: center;
	flex-direction: column;
   }
   .content-footer{
	   width: 100%;
	   display: flex;
	   flex-direction: column;
	   margin-bottom: 15rpx;
	   text{
		   font-size: 36rpx;
		   width: 100%;
		   height: 110rpx;
		   margin-top: 16rpx;
		   background: #FFFFFF;
		   display: flex;
		   text-align: center;
		   justify-content: center;
		   flex-direction: column; 
	   }
   }
}	

</style>
